<?php
	date_default_timezone_set('Asia/Ho_Chi_Minh');
	ob_start();
	session_start();
	if(!isset($_SESSION['ses_level'])){
		header("location:login.php");
		exit();
	}
	require("libraries/config.php");
	require("libraries/functions.php");
	require("libraries/database.php");
	if(isset($_GET['mod'])){
		switch($_GET['mod']){
			case "category" 	: require("controllers/category/controller.php");
			break;
			case "menu" 		: require("controllers/menu/controller.php");
			break;
			case "user" 		: require("controllers/user/controller.php");
			break;
			case "sales" 		: require("controllers/sales/controller.php");
			break;
			case "product" 		: require("controllers/product/controller.php");
			break;
			case "meterials" 	: require("controllers/meterials/controller.php");
			break;
			case "intro" 		: require("controllers/intro/intro.php");
			break;
			case "provider" 	: require("controllers/provider/controller.php");
			break;
			case "shopping"		: require("controllers/shopping/controller.php");
			break;
			case "shopping2"		: require("controllers/shopping2/controller.php");
			break;
			case "shopping3"		: require("controllers/shopping3/controller.php");
			break;
			case "order"		: require("controllers/order/controller.php");
			break;
			case "report"		: require("controllers/report/controller.php");
			break;
			default 			: require("controllers/home.php");
		}
	}else{
		require("controllers/home.php");
	}
	ob_end_flush();
